SA-MP Forums Archive
*** Terrible Title Removed - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: *** Terrible Title Removed (/showthread.php?tid=387245)



*** Terrible Title Removed - cplmason - 23.10.2012

CMDpec(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] == 0) return SendClientMessage(playerid, error, "You aren't an admin!");
new id, string[256], slot, Float, Float:y, Float:z, Float:a;
if(sscanf(params, "s[256]I[1]", string, slot))
if(playerid == id) return SendClientMessage(playerid, error, "You can't spectate yourself!");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid, error, "That player is not connected!");
if(PlayerInfo[playerid][pAdmin] > 0 && IsPlayerConnected(id))
{
if(isnull(params) || isnull(string)) SendClientMessage(playerid, error, "Syntax - /spec(tate) [playerid/'off']");
if(!strcmp(string, "off", true) || !strcmp(string, "stop", true) && IsSpectating[playerid] == false)
return SendClientMessage(playerid, error, "You aren't spectating anyone!");
if(!strcmp(string, "off", true) || !strcmp(string, "stop", true) && IsSpectating[playerid] == true)
{
IsSpectating[playerid] = false;
TogglePlayerSpectating(playerid, 0);
SetPlayerPos(playerid, SpecX[playerid], SpecY[playerid], SpecZ[playerid]);
SetPlayerFacingAngle(playerid, SpecA[playerid]);
SendClientMessage(playerid, success, "You are no longer spectating!");
}
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(!strcmp(string, i, true))
{
new string1[256];
format(string1, sizeof(string1), "You are now spectating %s (%d)! Type /spec(tate) off/stop to stop.", RPName(id), id);
GetPlayerPos(playerid, x, y, z);
GetPlayerFacingAngle(playerid, a);
SpecX[playerid] = x;
SpecY[playerid] = y;
SpecZ[playerid] = z;
SpecA[playerid] = a;
IsSpectating[playerid] = true;
TogglePlayerSpectating(playerid, 1);
SendClientMessage(playerid, success, string1);
if(IsPlayerInAnyVehicle(id)) PlayerSpectateVehicle(playerid, GetPlayerVehicleID(id), 1);
if(!IsPlayerInAnyVehicle(id)) PlayerSpectatePlayer(playerid, id, 1);
}
}
}
return 1;
}


Re: Help please - Youice - 23.10.2012

what's your issue?


Re: Help please - cplmason - 23.10.2012

Arguement mismatch for argument number 2


Re: Help please - Youice - 23.10.2012

which line? show us the line


Re: Help please - cplmason - 23.10.2012

f(!strcmp(string, i, true))


Re: Help please - cplmason - 23.10.2012

Please help


Re: Help please - HyDrAtIc - 23.10.2012

it's:

Код:
if(!strcmp(string, i,true))
not f(!strcmp(string, i, true))


Re: Help please - cplmason - 23.10.2012

Yea James thats what i ment but it dont work


Re: Help please - Youice - 23.10.2012

Код:
if(!strcmp(string, strval(i), true))



Re: Help please - cplmason - 23.10.2012

Quote:
Originally Posted by Youice
Посмотреть сообщение
Код:
if(!strcmp(string, strval(i), true))
After Using this i get the Same problem with arguement 1 but no Errors with ARGUMENT 2