26.03.2012, 19:44
Hello guys im making simple command for player so when player do
/Appeler he will get a call to someone and he will get a attachobject phone on his hand
the probleme is how to add it on the Hand :/
this is Code
and when he Hungup /rac the Object Destroy how to destroy it
CODE
/Appeler he will get a call to someone and he will get a attachobject phone on his hand
the probleme is how to add it on the Hand :/
this is Code
Код:
if(strcmp(cmd, "/appeler", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /appeler [Numero]");
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /numero (ID du Joueur)");
return 1;
}
if(PlayerInfo[playerid][pPnumber] == 0)
{
SendClientMessage(playerid, COLOR_GRAD2, " Nophone !");
return 1;
}
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s blablabla.", sendername);
SetPlayerAttachedObject(playerid, 6, 18865, 2, 0.120000, 0.040000, -0.003500, 0, 100, 100, 1.4, 1.4, 1.4);
CODE
Код:
if(strcmp(cmd, "/rac", true) == 0 || strcmp(cmd, " ", true) == 0)
{
if(IsPlayerConnected(playerid))
{
new caller = Mobile[playerid];
if(IsPlayerConnected(caller))
{
if(caller != INVALID_PLAYER_ID)
{
if(caller != 255)
{
if(caller < 255)
{
SendClientMessage(caller, COLOR_GRAD2, " hungup.");
CellTime[caller] = 0;
CellTime[playerid] = 0;
SendClientMessage(playerid, COLOR_GRAD2, " Ihungup.");
Mobile[caller] = 255;
}
Mobile[playerid] = 255;
CellTime[playerid] = 0;
RingTone[playerid] = 0;
PlayerInfo[playerid][pSpeaker] = 0;
UnidentifedCall[playerid] = 0;
}
}
}
SendClientMessage(playerid, COLOR_GRAD2, " takes out the phone.");
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_STOPUSECELLPHONE);
}
return 1;
}


