[HELP] Bug /plate
#1

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.
Reply
#2

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.
Reply
#3

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

help please?
Reply
#5

up up up
Reply
#6

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.");
Reply
#7

thank's
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)