Jump to content
  • 0

Create Pickup


ExTREME.

Question

7 answers to this question

Recommended Posts

pf man eu am zis cum aflu codu ca de creat stiu sa il fac:))

Defapt , ai intrebat cum creezi un pickup si cum aflti coordonatele.Ca sa afli coordonatele foloseste MTA sau compileaza

filterscriptul asta :

[pawn]//------------------------------------------------------------------

#include <a_samp>

//------------------------------------------------------------------

new str[256];

new Float:Pos[MAX_PLAYERS][4];

new PosSelected[MAX_PLAYERS];

//------------------------------------------------------------------

public OnPlayerCommandText(playerid,cmdtext[])

{

new cmd[256],idx;

cmd = strtok(cmdtext,idx);

if(!strcmp(cmdtext,"/scoordonate",true,4))

{

GetPlayerPos(playerid,Pos[playerid][0],Pos[playerid][1],Pos[playerid][2]);

GetPlayerFacingAngle(playerid,Pos[playerid][3]);

PosSelected[playerid] = 1;

format(str,256,"Coordonate salvate: %.4f,%.4f,%.4f ",Pos[playerid][0],Pos[playerid][1],Pos[playerid][2],Pos[playerid][3]);

  new File:fhandle;

            fhandle = fopen("coordonate.txt",io_append);

fwrite(fhandle,str);

  fclose(fhandle);

  PosSelected[playerid] = 0;

    return 1;

}

return 0;

}

//------------------------------------------------------------------

strtok(const string[], &index)

{

new length = strlen(string);

while ((index < length) && (string[index] <= ' ') && (string[index] > '\r'))

{

  index++;

}

//------------------------------------------------------------------

new offset = index;

new result[30];

while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)) && (string[index] > '\r'))

{

  result[index - offset] = string[index];

  index++;

}

result[index - offset] = EOS;

return result;

}

//------------------------------------------------------------------[/pawn]

Il bagi pe server , si scri /scoordonate.Coordonatele se vor salva intr-un fisier in scriptfiles (coordonate.txt).

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.