another problem[solved]
#1

i use seif's include for vehicles. i want to make a command:
pawn Код:
if (strcmp("/respray", cmdtext, true) == 0)
    {
      GetVehicleID(playerid);
    ResprayVehicle(vehicleid);
        return 1;
    }
but i get:
Код:
C:\Documents and Settings\^^\My Documents\NikeRaptor\gamemodes\raz.pwn(597) : error 017: undefined symbol "GetVehicleID"
C:\Documents and Settings\^^\My Documents\NikeRaptor\gamemodes\raz.pwn(598) : error 017: undefined symbol "vehicleid"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
help?


Reply
#2

come on ! i think that's not hard
Reply
#3

https://sampwiki.blast.hk/wiki/GetPlayerVehicleID

pawn Код:
if(strcmp("/respray", cmdtext, true) == 0)
{
if(IsPlayerInAnyVehicle(playerid))
{
ResprayVehicle(GetPlayerVehicleID(playerid));
}
return 1;
}
Reply
#4

idk wat u that seif thing is but is simple like
pawn Код:
if (strcmp("/respray", cmdtext, true) == 0)
{
if(IsPlayerInAnyVehicle(playerid))
{
new vehicle;
vehicle = GetPlayerVehicleID(playerid);
SetVehicleHealth(vehicle,1000.0);
}
else
{
SendClientMessage(playerid, COLOR_RED, "Error: You must be in a vehicle to use this command!");
}
return 1;
}
Reply
#5

Quote:
Originally Posted by Don Correlli
https://sampwiki.blast.hk/wiki/GetPlayerVehicleID

pawn Код:
if(strcmp("/respray", cmdtext, true) == 0)
{
if(IsPlayerInAnyVehicle(playerid))
{
ResprayVehicle(GetPlayerVehicleID(playerid));
}
return 1;
}
thaaanks! it worked!
Quote:
Originally Posted by cloud9
idk wat u that seif thing is but is simple like
pawn Код:
if (strcmp("/respray", cmdtext, true) == 0)
{
if(IsPlayerInAnyVehicle(playerid))
{
new vehicle;
vehicle = GetPlayerVehicleID(playerid);
SetVehicleHealth(vehicle,1000.0);
}
else
{
SendClientMessage(playerid, COLOR_RED, "Error: You must be in a vehicle to use this command!");
}
return 1;
}
seif's script repair car's body , not just health!
Reply
#6

Your codes have wasted brackets in my opinion.
I prefer coding in that way(fixed identiation aswell):
pawn Код:
if(!strcmp(cmdtext,"/respray",true))
{
  if(!IsPlayerInAnyVehicle(playerid))
    return SendClientMessage(playerid,color,"You have to be inside a vehicle!");
  SetVehicleHealth(GetPlayerVehicleID(playerid),1000.0);
  return 1;
}
Reply


Forum Jump:


Users browsing this thread: