Quick Question
#1

So my question is,I use a GF edit but I want to use this also in a TW GM.
How can I make a car available only if the player has the name X_Y.
Like,you enter the car and sends you the message "You are not Chuck Norris ! " and removes you from the vehicle.
Only if your name is Chuck_Norris you can drive the car.This is just an example.
I know how to send the message and how to remove player from vehicle but IDK how to do the name thing.
Thanks in advance
Reply
#2

GetPlayerName(playerid,name,sizeof(name));
if(strcmp(name,"ChuckNorris",false) == 0){
//hier was wenn er chuck norris heiЯt
else
{
SendClientMessage(playerid,COLOR_WHATEVER,"You Are Not chuck norris");
//Here A function like PlayerExitVehicle(playerid,true); I don't know what name the function is XDD
}

Hope it works ^^

Bearfist
Reply
#3

if(newcar == 172)
{
GetPlayerName(playerid,name,sizeof(name));
if(strcmp(name,"Cool_Guy",false) == 0){}
else
{
SendClientMessage(playerid,0xE4287CFF," You are not Cool Guy !");
RemovePlayerFromVehicle(playerid);
}
}

One error,name is an undefined symbol.
Reply
#4

Add the below over GetPlayerName
Код:
new name[MAX_PLAYER_NAME];
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)