SA-MP Forums Archive
[HELP] Bug /plate - 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: [HELP] Bug /plate (/showthread.php?tid=502826)



[HELP] Bug /plate - Elanggg - 26.03.2014

Quote:

CMD: plate( playerid, params[] )
{
if(IsACop(playerid) || PlayerInfo[playerid][pMember] == 4 && PlayerInfo[playerid][pDivision] == 2 || PlayerInfo[playerid][pMember] == 4 && PlayerInfo[playerid][pRank] >= 5 || (PlayerInfo[playerid][pMember] == 12 && PlayerInfo[playerid][pDivision] == 2)) return SendClientMessage( playerid, -1, "SERVER: You're not faction LEO.");

new szPlate[32], iVictim, ivVictim;//iVictim = id Player yang mau diubah platenya, ivVictim = id dynamic mobil player yang mau diubah plate
if( sscanf( params, "uds[32]", iVictim, ivVictim, szPlate ) || strlen( szPlate ) > 10)
return SendClientMessage( playerid, -1, "Server: /plate [playerid] [vehID] [plate(1-10 letters)]" );
else if( !IsPlayerConnected( iVictim ) )
return SendClientMessage( playerid, -1, "Error: That player isn't connected." );*/
/*else if( !IsPlayerInAnyVehicle( iVictim ) )
return SendClientMessage( playerid, -1, "Error: That player isn't in a vehicle." );*/
/*else
{
new pvid = -1;
for( new d = 0 ; d < MAX_PLAYERVEHICLES; d++)
{
if(PlayerVehicleInfo[iVictim][d][pvId] != INVALID_PLAYER_VEHICLE_ID)
{
if(PlayerVehicleInfo[iVictim][d][pvId] == ivVictim)
{
pvid = d;
break;
}
}
}
if(pvid == -1) return SendClientMessageEx(playerid,COLOR_GREY,"Veh's ID doesn't belong to player's ID");
else
{
new szString[128] ;
//format( v_Plate[ivVictim], 32, "%s", szPlate );
SetVehicleNumberPlate( ivVictim, szPlate );
SetVehicleToRespawn( ivVictim );

format(PlayerVehicleInfo[iVictim][pvid][pvNumberPlate], 32, "%s", szPlate);

format( szString, 128, "You've set %s's vehicle plate to %s.",GetPlayerNameEx(iVictim), szPlate );
SendClientMessage( playerid, -1, szString );
format( szString, 128, "Police/LEO set your vehicle plate to %s.", szPlate );
SendClientMessage( iVictim, -1, szString );
}
}
return 1;

please help me, why LSPD cannot /plate? "You're not Faction LEO"
and why civilians can? please help me fix this bug.

*sorry for bad my english.


Re: [HELP] Bug /plate - luis_mendoza - 26.03.2014

You have set that if they are a cop or any other faction it sends them the SendClientMessage. So that's why they can't.


Re: [HELP] Bug /plate - Elanggg - 26.03.2014

I have to delete the sendclientmessage? after i delete how to civilian can not use the commands? please help a little enlightenment.


Re: [HELP] Bug /plate - Elanggg - 26.03.2014

help please?


Re: [HELP] Bug /plate - Elanggg - 26.03.2014

up up up


Re: [HELP] Bug /plate - Schocc - 26.03.2014

Use the negation operador. '!' .

pawn Код:
if (!(IsACop(playerid) ||
    (PlayerInfo[playerid][pMember] == 4 && PlayerInfo[playerid][pDivision] == 2) ||
    (PlayerInfo[playerid][pMember] == 4 && PlayerInfo[playerid][pRank] >= 5) ||
    (PlayerInfo[playerid][pMember] == 12 && PlayerInfo[playerid][pDivision] == 2) ))
        return SendClientMessage( playerid, -1, "SERVER: You're not faction LEO.");



Re: [HELP] Bug /plate - Elanggg - 26.03.2014

thank's