if(dialogid == DIALOG_CIASAT)
{
if(response == 1)
{
new ID =strval(inputtext);
if(!strlen(inputtext))
{
SendClientMessage(playerid,COLOR_ERROR,"Please enter the Player ID of the person you want to view.");
return 1;
}
if(!IsPlayerConnected(ID))
{
SendClientMessage(playerid,COLOR_ERROR,"That Player ID is not connected to the server. Please enter the Player ID of the person you want to view.");
return 1;
}
if(IsSpawned[ID] != 1)
{
SendClientMessage(playerid,COLOR_ERROR,"That Player ID is dead. Please enter the Player ID of the person you want to view.");
return 1;
}
if(JailTime[ID] >= 1)
{
SendClientMessage(playerid,COLOR_ERROR,"That Player ID is in prison. Please enter the Player ID of the person you want to view.");
return 1;
}
if(IsPlayerInAnyVehicle(ID))
{
new sname[24];
GetPlayerName(ID,sname,sizeof(sname));
new pveh =GetPlayerVehicleID(ID);
CIAPlayerBeingViewed[playerid] =ID;
CIAIsBeingWatched[ID] =1;
for(new w=0; w<13; w++)
{
GetPlayerWeaponData(playerid,w,PlayerWeapon[playerid][w],PlayerAmmo[playerid][w]);
}
new pint = GetPlayerInterior(ID);
SetPlayerInterior(playerid,pint);
TogglePlayerSpectating(playerid,1);
PlayerSpectateVehicle(playerid,pveh);
SendClientMessage(playerid,COLOR_DEADCONNECT,"[[_CIA Satelite Viewing_]]");
format(string,sizeof(string),"You are now viewing %s(%d) through the CIA Satelite Imagery.",sname,ID);
SendClientMessage(playerid,COLOR_LIGHTBLUE,string);
return 1;
}
if(!IsPlayerInAnyVehicle(ID))
{
new sname[24];
GetPlayerName(ID,sname,sizeof(sname));
CIAPlayerBeingViewed[playerid] =ID;
CIAIsBeingWatched[ID] =1;
for(new w=0; w<13; w++)
{
GetPlayerWeaponData(playerid,w,PlayerWeapon[playerid][w],PlayerAmmo[playerid][w]);
}
new pint = GetPlayerInterior(ID);
SetPlayerInterior(playerid,pint);
TogglePlayerSpectating(playerid,1);
PlayerSpectatePlayer(playerid,ID);
SendClientMessage(playerid,COLOR_DEADCONNECT,"[[_CIA Satelite Viewing_]]");
format(string,sizeof(string),"You are now viewing %s(%d) through the CIA Satelite Imagery.",sname,ID);
SendClientMessage(playerid,COLOR_LIGHTBLUE,string);
return 1;
}
return 1;
}
}
if (ID == playerid)
{
SendClientMessage(playerid,COLOR_ERROR,"You cannot use it on yourself. Please enter the Player ID of the person you want to view.");
return 1;
}
|
Compare if IDs are equals:
pawn Код:
|