01.11.2009, 15:00
Hey, I've tried to make this /c [number] to work...
When I type /c and a number which is available, it says it's not.
Help please =)
When I type /c and a number which is available, it says it's not.
pawn Код:
dcmd_c(playerid,params[])
{
new string[128],number,pName[MAX_PLAYER_NAME],idName[MAX_PLAYER_NAME],proxp[128],proxid[128];
GetPlayerName(playerid,pName,sizeof(pName));
if(sscanf(params,"d",number)) return SendClientMessage(playerid,COLOR_GREY,".: Usage: /c [number] :.");
Sextext(playerid);
format(proxp,128,"%s uses %s cellphone",pName,Sex);
ProxDetector(10.0,playerid,proxp,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_USECELLPHONE);
if(PlayerInfo[playerid][pCellphone] == 0) return SendClientMessage(playerid,COLOR_DARKRED,".: Info: You don't have a cellphone :.");
for(new i=0; i<MAX_PLAYERS; i++)
{
if(PlayerInfo[i][pCellphone] != number)
{
SendClientMessage(playerid,COLOR_DARKRED,".: Info: Call initiated, \"Number not available\" :.");
PlayerInfo[playerid][pOncall] = 1;
return 1;
}
if(PlayerInfo[i][pCellphone] == number)
{
GetPlayerName(i,idName,sizeof(idName));
PlayerInfo[i][pCalling] = playerid;
PlayerInfo[playerid][pCalling] = i;
format(string,128,".: Info: Number %d is calling :.",PlayerInfo[playerid][pCellphone]);
format(proxid,128,"%s's phone is sounding",idName);
SendClientMessage(i,COLOR_YELLOW,string);
ProxDetector(10.0,i,proxid,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
}
return 1;
}