12.11.2009, 20:37
Okay, I need help with this one. I have a mysql script and am running some cars of it and some static cars not off it. So far I've managed to allow player to access the unlocked AddStaticVehicle cars in the script. But now if a vehicle if for sale it ejects the person before they can /buyvehicle it and also it ejects a player from his own vehicle. Heres what I have so far:
I think vInfo[vid][vBuyAble]=2 defines if the vehicle is buyable...
any help is much appricated
Код:
public OnPlayerStateChange(playerid, newstate, oldstate) { if(newstate == PLAYER_STATE_DRIVER) { new string[128]; new vehicle = GetPlayerVehicleID(playerid); new vid; if(vehicle >= 44) { if(vInfo[vid][vOwnerId] != PlayerInfo[playerid][pSQLId]) { SendClientMessage(playerid, COLOR_RED, "This Isent Your Vehicle"); RemovePlayerFromVehicle(playerid); } if(vInfo[vehicle][vBuyAble] == 1) { format(string,sizeof(string),"This vehicle is for sale, you can buy it for %d$ (/buyvehicle)",vInfo[vehicle][vPrice]); SendClientMessage(playerid,0x33CCFFFF,string); } else if(vInfo[vehicle][vBuyAble] == 2 && PlayerInfo[playerid][pSQLId] == vInfo[vehicle][vOwnerId]) { SendClientMessage(playerid,0x33CCFFFF,"Welcome to your vehicle."); } } } return 1; }
any help is much appricated