Car check
#1

Hi. Need command. For example for policeman /car PlayerID. And this command show for policeman: if player using illegal car ( carID - 415 ) show for him text, that player using illegal car. If not, show text, that OK.
Reply
#2

This is Scripting help, not Requesting section, make some effort atleast and we can help fix errors or anything
Reply
#3

Ok, I tryed... But system show only: This players is clear..

Код:
CMD:check(playerid, params[])
{
        new
            giveplayerid;

        if ( sscanf( params, "u", giveplayerid ) ) SendClientMessage(pid, COLOR_RED, "* {ff9900}/check ID" );
        else if ( giveplayerid == INVALID_PLAYER_ID ) SendClientMessage(pid, COLOR_RED, "* Invalid ID!" );
        else if ( giveplayerid == playerid ) SendClientMessage(pid, COLOR_RED, "* Invalid ID!" );
		else
		{
        
        new giveplayerid = GetPlayerVehicleID(giveplayerid);

        if(giveplayerid == 415)
        {
        SendClientMessage(pid, COLOR_RED, "* Text!" );
		}
		else
		{
		SendClientMessage(pid, COLOR_RED, "* Player is clear!" );
		}
		}
			return 1;
}
Reply
#4

Quote:
Originally Posted by ,TomY'
Посмотреть сообщение
Ok, I tryed... But system show only: This players is clear..

Код:
CMD:check(playerid, params[])
{
        new
            giveplayerid;

        if ( sscanf( params, "u", giveplayerid ) ) SendClientMessage(pid, COLOR_RED, "* {ff9900}/check ID" );
        else if ( giveplayerid == INVALID_PLAYER_ID ) SendClientMessage(pid, COLOR_RED, "* Invalid ID!" );
        else if ( giveplayerid == playerid ) SendClientMessage(pid, COLOR_RED, "* Invalid ID!" );
		else
		{
        
        new giveplayerid = GetPlayerVehicleID(giveplayerid);

        if(giveplayerid == 415)
        {
        SendClientMessage(pid, COLOR_RED, "* Text!" );
		}
		else
		{
		SendClientMessage(pid, COLOR_RED, "* Player is clear!" );
		}
		}
			return 1;
}
Too many mistake

PHP код:
CMD:check(playeridparams[])
{
    new 
giveplayerid;
    if(
sscanf(params,"u",giveplayerid)) return SendClientMessage(pidCOLOR_RED"* {ff9900}/check ID" );
        if(
giveplayerid == INVALID_PLAYER_ID) return SendClientMessage(pidCOLOR_RED"* Invalid ID!" );
    if(
GetPlayerVehicleID(playerid) == 415) return SendClientMessage(pidCOLOR_RED"* Text!" );
    
SendClientMessage(playeridCOLOR_RED"* Player is clear!" );
    return 
1;

Reply
#5

Still show this: SendClientMessage(playerid, COLOR_RED, "* Player is clear!" );
Reply
#6

PHP код:
CMD:check(playeridparams[])
{
    new 
giveplayerid;
    if(
sscanf(params,"u",giveplayerid)) return SendClientMessage(pidCOLOR_RED"* {ff9900}/check ID" );
    if(
giveplayerid == INVALID_PLAYER_ID) return SendClientMessage(pidCOLOR_RED"* Invalid ID!" );
    if(
GetPlayerVehicleID(playerid) == 415)
    {
            
SendClientMessage(pidCOLOR_RED"* Text!" );
    }
    else
    {
            
SendClientMessage(playeridCOLOR_RED"* Player is clear!" );
    }
    return 
1
Reply
#7

If You mean Cheetah by ID 415 then the code is:
PHP код:
CMD:check(playeridparams[])
{
    new 
targetid;
    if(
sscanf(params,"u",targetid)) return SendClientMessage(playeridCOLOR_RED"* {ff9900}/check ID" );
    if(!
IsPlayerConnected(targetid)) return SendClientMessage(playeridCOLOR_RED"* Invalid ID!" );
    if(
GetVehicleModel(GetPlayerVehicleID(targetid)) == 415) return SendClientMessage(playeridCOLOR_RED"This player is using illegal vehicle!" );
    
SendClientMessage(playeridCOLOR_RED"* Player is clear!" );
    return 
1;

but if You meant vehicleid (415) in general:
PHP код:
CMD:check(playeridparams[])
{
    new 
targetid;
    if(
sscanf(params,"u",targetid)) return SendClientMessage(playeridCOLOR_RED"* {ff9900}/check ID" );
    if(!
IsPlayerConnected(targetid)) return SendClientMessage(playeridCOLOR_RED"* Invalid ID!" );
    if(
GetPlayerVehicleID(targetid) == 415) return SendClientMessage(playeridCOLOR_RED"This player is using illegal vehicle!" );
    
SendClientMessage(playeridCOLOR_RED"* Player is clear!" );
    return 
1;

Reply
#8

I Made a silly mistake up
Try this

PHP код:
CMD:check(playeridparams[])
{
    new 
giveplayerid;
    if(
sscanf(params,"d",giveplayerid)) return SendClientMessage(pidCOLOR_RED"* {ff9900}/check ID" );
        if(
giveplayerid == INVALID_PLAYER_ID) return SendClientMessage(pidCOLOR_RED"* Invalid ID!" );
    if(
GetPlayerVehicleID(giveplayerid) == 415) return SendClientMessage(pidCOLOR_RED"* Text!" );
    
SendClientMessage(playeridCOLOR_RED"* Player is clear!" );
    return 
1;

Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)