SA-MP Forums Archive
Quick Question - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Quick Question (/showthread.php?tid=75121)



Quick Question - FreeSoul - 29.04.2009

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


Re: Quick Question - Bearfist - 29.04.2009

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



Re: Quick Question - FreeSoul - 29.04.2009

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.


Re: Quick Question - afei - 29.04.2009

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