13.09.2011, 17:09
Alright so I have this command when a player types /plant it will create a pickup, set the map icon for that player who did the cmd, check the team and blah blah blah but the problem is, I type the cmd and it works the first time but than if I do it again nothing happens. The rest of my cmds work still, but /plant wont -.- here is the code:
Код:
if(strcmp(cmdtext,"/plant",true) ==0) { new giveplayerid = Planter[playerid]; if(gTeam[playerid] == TEAM_SNEAK) { new Float:X, Float:Y, Float:Z; GetPlayerPos(giveplayerid, X,Y,Z); Pickup2 = CreatePickup(1212, 3,X,Y,Z,-1); SendClientMessage(giveplayerid, TEAM_PD_COLOR, "You have planted a distraction"); SetPlayerMapIcon(giveplayerid,1,X,Y,Z,56,0,MAPICON_LOCAL); Planter[giveplayerid]++; return 1; } else if(Planter[giveplayerid] >= 4) { SendClientMessage(giveplayerid,COLOR_BLUE, "You can't plant more than 3 distractions!"); return 1; } }