02.04.2011, 17:34
Hi ! First sorry for my English . PLease , someone help me with a little problem . I want to add personal cars in my gamemode 0.3c . I tried with new variable; and with car id but both doesn't work . Please help me !
new pcar;
pcar = AddStaticVehicle(............);
if(newstate == PLAYER_STATE_DRIVER)
{
new pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
new v = GetPlayerVehicleID(playerid);
if(v == pcar)
{
if(!strcmp(name, "OwnerName", true))
{
SendClientMessage(playerid, 0x999999AA, "Welcome to your private vehicle!");
}
else
{
SendClientMessage(playerid, 0x999999AA, "This vehicle belongs to OwnerName!");
RemovePlayerFromVehicle(playerid);
}
}
return 1;
}
H:\Global\gamemodes\petru.pwn(6852) : error 017: undefined symbol "name"
if(newstate == PLAYER_STATE_DRIVER)
{
new pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
new v = GetPlayerVehicleID(playerid);
if(v == pcar)
{
if(!strcmp(pname, "OwnerName", true))
{
SendClientMessage(playerid, 0x999999AA, "Welcome to your private vehicle!");
}
else
{
SendClientMessage(playerid, 0x999999AA, "This vehicle belongs to OwnerName!");
RemovePlayerFromVehicle(playerid);
}
}
return 1;
}