SA-MP Forums Archive
BIG BUG CANT FIX - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: BIG BUG CANT FIX (/showthread.php?tid=175038)



BIG BUG CANT FIX - farris - 08.09.2010

IT KILLS ME NOT THE PERSON WHOS NOT ANNA_CORTEZ WTF
Quote:

stock PlayerName(playerid)
{
new PlrName[MAX_PLAYER_NAME];
GetPlayerName(playerid,PlrName,sizeof(PlrName));
return PlrName;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{

if(newstate == PLAYER_STATE_DRIVER && oldstate == PLAYER_STATE_ONFOOT)
{
new VehicleID = GetPlayerVehicleID(playerid);

if(VehicleID == xxannajpxx)
{

if(strcmp(PlayerName(playerid), "Anna_Cortez", true) != 0)
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, COLOR_RED, "You dare touch The car of Anna_Cortez? PERISH IN HELL!!! ");
SendClientMessage(playerid, COLOR_RED, "Nucleur Warheads provided by U.S. have been automatically targeted at your head");
SetTimer("dday", 6000, false);
}

}
}

return 1;
}
public dday(playerid)
{
{
{
new Float, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
CreateExplosion(x, y, z, 0, 1.0);
SetPlayerHealth(playerid, 0);
}
}
return 1;
}




Re: BIG BUG CANT FIX - StreetGT - 08.09.2010

don't use CAPS!


Re: BIG BUG CANT FIX - CyNiC - 08.09.2010

Change for it:
pawn Код:
if(strcmp(PlayerName(playerid), "Anna_Cortez", true) == 0)



Re: BIG BUG CANT FIX - Rachael - 08.09.2010

I would change it so the function returns before the "explode" part of the script if the name is yours.
I am not sure that you can use a function in strcmp, so perhaps try removing it, see if it works.
also, you need to use SetTimerEx instead of SetTimer.
Код:
new drivername[MAX_PLAYER_NAME];
GetPlayerName(playerid,drivername,sizeof(drivername));

if(!strcmp(drivername, "Anna_Cortez", true)) return 1;

RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, COLOR_RED, "You dare touch The car of Anna_Cortez? PERISH IN HELL!!! ");
SendClientMessage(playerid, COLOR_RED, "Nucleur Warheads provided by U.S. have been automatically targeted at your head");
SetTimerEx("dday", 6000, false,"d",playerid);