12.12.2009, 17:09
pawn Код:
new bool: Tazer[MAX_PLAYERS];
pawn Код:
public OnPlayerEnterStreamedCheckpoint(playerid, streamid)
{
if(streamid == CopSaleCP)
{
new string[256],string2[128];
new playername[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
format(string2,sizeof string2,"Welcome Officer %s ! Anything for You ?",playername);
format(string,sizeof(string),"Tazer\t\t\t\t\t\t\t\t\t\t\t\b$25000",playername);
ShowPlayerDialog(playerid,2,DIALOG_STYLE_LIST,string2,string,"Buy","Cancel");
return 1;
}
return 1;
}
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 2 && response)
{
_:Tazer[playerid] = true;
SendClientMessage(playerid,0xFFFFFFAA,"You can use now /tazer.");
}
return 1;
}
pawn Код:
public OnPlayerCommandText(playerid,cmdtext[])
{
if(!strcmp(cmdtext,"/tazer",true))
{
if(_:Tazer[playerid] == false) return 1;
// rest of code
}
}