07.01.2012, 20:47
Hi, guys!
I have a problem. I dont know how to fix it. Here is the code:
And when I type /thing it says "what?" Well, itr should says: "Thing for player: /thing [player name]" But it isnt. So could you help me? I hope you understand me. Thanks for any advice
I have a problem. I dont know how to fix it. Here is the code:
pawn Код:
if(!strcmp(cmdtext, "/thing", true,6))
{
if(playerDB[playerid][specialybe]!=4){SendClientMessage(playerid,COLOR," Its not for you."); return 1;}
if(cmdtext[6]==0){SendClientMessage(playerid, BLUE, "* Thing for player: /thing [player name]"); return 1;}
new vardas[MAX_PLAYER_NAME];
strmid(vardas,cmdtext[7],0,MAX_PLAYER_NAME);
new id = GetPlayeridMid(vardas);
if (id == INVALID_PLAYER_ID){ SendClientMessage(playerid, RED, "* Invalid player"); return 1;}
if (id == playerid){ SendClientMessage(playerid, RED, "* What?!"); return 1;}
new Float:Coo[3];
GetPlayerPos(id,Coo[0],Coo[1],Coo[2]);
if(!PlayerToPoint(5, playerid, Coo[0],Coo[1],Coo[2])){SendClientMessage(playerid, RED, "* The player is to far"); return 1;}
if(playerDB[id][vmegzas])
{
SendClientMessage(playerid,COLOR,"* The player have the thing.");
return 1;
}
if(GetPlayerMoneyA(playerid)<1000)
{
SendClientMessage(playerid,COLOR," it cost1000LT.");
return 1;
}
GivePlayerMoneyA(playerid,-1000);
SendClientMessage(playerid,COLOR,"* Player has now test.");
new msg[512];
format(msg,sizeof(msg),"want it? Price1000LT.",id);
ShowPlayerDialog(playerid,8088,DIALOG_STYLE_MSGBOX,"Thing:",msg,"Yes","No");
return 1;
}