public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp(cmdtext, "/GarageOpen", true)==0) { MoveObject (door, 1460.2858886719, -2214.7924804688, 8.5460910797119, 5); SendClientMessage(playerid, 0x0000000F, "Clan garage is now opening"); return 1; } if (strcmp(cmdtext, "/GarageClose", true)==0) { MoveObject (door, 1460.2858886719, -2214.7924804688, 14.546091079712, 5); SendClientMessage(playerid, 0x0000000F, "Clan garage is now closing."); return 1; } return 0; }
#include <a_samp> #define FILTERSCRIPT #if defined FILTERSCRIPT //new hall; new door; //new door_closed; Used for the closed position //new door_open; Used for rhe open position public OnFilterScriptInit() { print("\n--------------------------------------"); print(" Dave's clan garage enabled "); print("--------------------------------------\n"); CreateObject(8947, 1448.0778808594, -2214.7619628906, 15.599655151367, 0.000000, 0.000000, 90); //hall door = CreateObject(16773, 1460.2858886719, -2214.7924804688, 14.546091079712, 0.000000, 0.000000, 90); //door //door_closed = CreateObject(16773, 1460.2858886719, -2214.7924804688, 14.546091079712, 0.000000, 0.000000, 90); //door_closed //door_open = CreateObject(16773, 1460.2858886719, -2214.7924804688, 8.5460910797119, 0.000000, 0.000000, 90); //door_open return 1; } public OnFilterScriptExit() { return 1; } #else #endif public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp(cmdtext, "/GarageOpen", true)==0) { MoveObject (door, 1460.2858886719, -2214.7924804688, 8.5460910797119, 5); SendClientMessage(playerid, 0x0000000F, "Clan garage is now opening"); return 1; } if (strcmp(cmdtext, "/GarageClose", true)==0) { MoveObject (door, 1460.2858886719, -2214.7924804688, 14.546091079712, 5); SendClientMessage(playerid, 0x0000000F, "Clan garage is now closing."); return 1; } return 0; }
if (strcmp(cmdtext, "/GarageOpen", true)==0) { new Name[MAX_PLAYER_NAME]; GetPlayerName(playerid, Name, sizeof(Name)); if(strcmp( Name, "your name","second name")) { MoveObject (door, 1460.2858886719, -2214.7924804688, 8.5460910797119, 5); SendClientMessage(playerid, 0x0000000F, "Clan garage is now opening"); } return 1; } if (strcmp(cmdtext, "/GarageClose", true)==0) { new Name[MAX_PLAYER_NAME]; GetPlayerName(playerid, Name, sizeof(Name)); if(strcmp( Name, "your name","second name")) { MoveObject (door, 1460.2858886719, -2214.7924804688, 14.546091079712, 5); SendClientMessage(playerid, 0x0000000F, "Clan garage is now closing."); } return 1; }
Originally Posted by Gilardo
Making the good one, please wait
Edited |
GetPlayerName(playerid, Name, sizeof(Name)); f(strcmp( Name, "your name")) { you command code }
Originally Posted by billiout
look again i update it!
|
Originally Posted by Kidel
Код:
GetPlayerName(playerid, Name, sizeof(Name)); f(strcmp( Name, "your name")) { you command code } not tested!!! |
new PlayerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
if(!strfind(PlayerName, "[your name here]", true) return 0;
if(strfind(PlayerName, "[your name here]", true)
{
Command Code here
return 1;
}