how add admin car
#1

Hello



How i Can Add Admin car in my server?
Reply
#2

Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER)
	{
	new vehmodel = GetVehicleModel(GetPlayerVehicleID(playerid));
	if(vmodel == MODEL && !IsPlayerAdmin(playerid)) // change MODEL to the modelid
	  {
	  DestroyVehicle(GetPlayerVehicleID(playerid));
	  }
	}

}
Reply
#3

that is good tnx


if player in car send error message "You are not admin"
how make that
Reply
#4

just add a
Код:
else {
SendClientMessage(playerid, yourcolor, "Your not admin!");
}
after the if statment finishes
Reply
#5

Quote:
Originally Posted by iLinx
Your not admin
You're not admin*

:P
Reply
#6

thank you very much
Reply
#7

i get 4 errors


Код:
C:\Documents and Settings\xxx\My Documents\LV - DM (-1.1)\LV - DM (-1.1)\LV - DM (-1.1)\LV - DM (-1.1-a)\gamemodes\x.pwn(13419) : warning 217: loose indentation
C:\Documents and Settings\xxx\My Documents\LV - DM (-1.1)\LV - DM (-1.1)\LV - DM (-1.1)\LV - DM (-1.1-a)\gamemodes\x.pwn(13419) : error 029: invalid expression, assumed zero
C:\Documents and Settings\xxx\My Documents\LV - DM (-1.1)\LV - DM (-1.1)\LV - DM (-1.1)\LV - DM (-1.1-a)\gamemodes\x.pwn(13419) : error 017: undefined symbol "newstate"
C:\Documents and Settings\xxx\My Documents\LV - DM (-1.1)\LV - DM (-1.1)\LV - DM (-1.1)\LV - DM (-1.1-a)\gamemodes\x.pwn(13421) : error 017: undefined symbol "newstate"
C:\Documents and Settings\xxx\My Documents\LV - DM (-1.1)\LV - DM (-1.1)\LV - DM (-1.1)\LV - DM (-1.1-a)\gamemodes\x.pwn(13424) : error 017: undefined symbol "vmodel"
C:\Documents and Settings\xxx\My Documents\LV - DM (-1.1)\LV - DM (-1.1)\LV - DM (-1.1)\LV - DM (-1.1-a)\gamemodes\x.pwn(13423) : warning 204: symbol is assigned a value that is never used: "vehmodel"
C:\Documents and Settings\xxx\My Documents\LV - DM (-1.1)\LV - DM (-1.1)\LV - DM (-1.1)\LV - DM (-1.1-a)\gamemodes\x.pwn(13423 -- 13435) : warning 217: loose indentation
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Reply
#8

pawn Код:
#include a_samp

public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER)
{
new vehmodel = GetVehicleModel(GetPlayerVehicleID(playerid));
if(vmodel == MODEL && !IsPlayerAdmin(playerid)) // change MODEL to the modelid
{
DestroyVehicle(GetPlayerVehicleID(playerid));
return 1;
}
else return SendClientMessage(playerid, 0xFFFFFFAA, "You're not an Admin!");
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)