How can I add /givekey
#4

Quote:
Originally Posted by Florin48
Посмотреть сообщение
not necessarily, he can create a KeyCar variable [playerid] = -1; when connecting and after trying to make the order.

CMD:givekey(playerid, params[])
{
new id;
sscanf(params,"u",id)) return SendClientMessage(playerid, -1, "/givekey [username/id]");
if(!IsPlayerInVehicle(playerid, /*Your vehicle*/)) return /*Message*/
KeyCar[id] = /*Your vehicle ID*/
...
return 1;
}

it's just a simple exemple, you must to try to make your own commands
While this will work, it's bad practise. There is a reason why vehicles have an enum, you're offering OP to write un-organized and potentially hard to read code. Not to even mention it won't be possible to save the given key, the key will be reset once the player disconnects which makes the function nearly useless.
Reply


Messages In This Thread
How can I add /givekey - by Varg - 29.07.2018, 10:22
Re: How can I add /givekey - by Rufio - 29.07.2018, 11:10
Re: How can I add /givekey - by Florin48 - 29.07.2018, 11:20
Re: How can I add /givekey - by Rufio - 29.07.2018, 11:24
Re: How can I add /givekey - by Florin48 - 29.07.2018, 11:35
Re: How can I add /givekey - by Rufio - 29.07.2018, 11:39
Re: How can I add /givekey - by Varg - 29.07.2018, 11:42
Re: How can I add /givekey - by Florin48 - 29.07.2018, 11:45

Forum Jump:


Users browsing this thread: 1 Guest(s)