21.01.2016, 12:39
Hello. So I have a "/fuelstation" command, which creates currently a checkpoint and 3dtext label. I want to replace the checkpoint with pickup, but I don't know, how to do that. I tried many options, but after compile, it still gives me warnings about tag mismatch.
See code:
See code:
PHP код:
CMD:fuelstation(playerid,params[])
{
new chn;
if(!IsPlayerAdmin(playerid)) SendClientMessage(playerid,-1,"Unknown command.");
else if(sscanf(params,"s",chn)) SendClientMessage(playerid,-1,"USAGE: /fuelstation [checkpoint name]");
else
{
new Float:x;new Float:y;new Float:z;
GetPlayerPos(playerid,x,y,z);
chn = CreateDynamicCP(1650, 1, Float:x, Float:y, Float:z, -1); <<It is for creating a pickup
Create3DTextLabel("Fuel station: \n/repair, /refuel, /cb (carbomb), \r\n/neon, /gascan", 0x008080FF, x,y,z, 40.0, 0, 0);
SetPlayerMapIcon(playerid,1,x,y,z,19,0,MAPICON_LOCAL);
new string[256];
new File:checkpoints=fopen("checkpoints.txt", io_append);
format(string, 256, "%s = CreateDynamicCP(%f,%f,%f,1.5,0,0,0,100);\r\n", chn,x, y, z);
fwrite(checkpoints, string);
fclose(checkpoints);
}
return 1;
}