SA-MP Forums Archive
hi help me please - 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)
+--- Thread: hi help me please (/showthread.php?tid=436428)



hi help me please - Siv - 11.05.2013

I got this cmd here

Код:
if(CarID == car1)
{
new PlayerName1[MAX_PLAYER_NAME];
GetPlayerName(playerid, PlayerName1, sizeof(PlayerName1));
if(strcmp(PlayerName1, "Melinda_Dawson", true) == 0)
{
SendClientMessage(playerid, RED,"Hey, welcome");
}
else
{
SendClientMessage(playerid, RED, "You do not have the keys to this car");
new Float:X,Float:Y,Float:Z;
GetPlayerPos(playerid, X, Y, Z);
SetPlayerPos(playerid, X+2, Y+2, Z+2);
}
}
it's working fine for me, but I need so it can be used to a name more "Henrik_white" could anyone help me please


Re: hi help me please - feartonyb - 11.05.2013

How do you mean? If you mean that only Melinda_Dawson and Henrik_White can enter the car then use this:

Код:
if(CarID == car1)
{
new PlayerName1[MAX_PLAYER_NAME];
GetPlayerName(playerid, PlayerName1, sizeof(PlayerName1));
if(strcmp(PlayerName1, "Melinda_Dawson", true) == 0)
{
SendClientMessage(playerid, RED,"Hey, welcome");
}
else if(strcmp(PlayerName1, "Henrik_White", true) == 0)
{
SendClientMessage(playerid, RED,"Hey, welcome");
}
else
{
SendClientMessage(playerid, RED, "You do not have the keys to this car");
new Float:X,Float:Y,Float:Z;
GetPlayerPos(playerid, X, Y, Z);
SetPlayerPos(playerid, X+2, Y+2, Z+2);
}
}