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;
}
Originally Posted by Seif_
Use printf() to debug.
|
Originally Posted by IntrozeN
huh?
don't understand, sorry... |
Originally Posted by Don Correlli
Quote:
|
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));
print("playerid name gotten");
if(sscanf(params,"d",number)) return SendClientMessage(playerid,COLOR_GREY,".: Usage: /c [number] :.");
print("sscanf done");
Sextext(playerid);
print("sextext checked");
format(proxp,128,"%s uses %s cellphone",pName,Sex);
ProxDetector(10.0,playerid,proxp,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
print("proxdetector sent");
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_USECELLPHONE);
print("special action preformed");
if(PlayerInfo[playerid][pCellphone] == 0) return SendClientMessage(playerid,COLOR_DARKRED,".: Info: You don't have a cellphone :.");
print("cellphone checked");
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;
print("no one had the number");
return 1;
}
if(PlayerInfo[i][pCellphone] == number)
{
print("someone had the 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;
}
if(PlayerInfo[i][pCellphone] != number)