public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/aduty", cmdtext, true, 10) == 0)
{
if(PlayerInfo[playerid][pAdmin] >= 2)
{
SendClientMessage(playerid,0xFF0000DB,"ERROR: You are not an Admin!");
}
else
{
adminduty[playerid] = 1;
SetPlayerSkin(playerid,217);
SendClientMessage(playerid,0x00FF0068,"You are now on duty.");
}
return 1;
}
if (strcmp("/adutyoff", cmdtext, true, 10) == 0)
{
if(adminduty[playerid] == 0)
{
SendClientMessage(playerid,0xFF0000DB,"ERROR: You are not on duty!");
}
else
{
adminduty[playerid] = 0;
SpawnPlayer(playerid);
SendClientMessage(playerid,0xFFB600BC,"You are now off duty.");
}
return 1;
}
}
CMD:aduty(playerid)
{
if(playerVariables[playerid][pAdmin] == 0 || !IsPlayerAdmin(playerid)) return SendClientMessage(playerid,0xFF0000DB,"ERROR: You are not an Admin!");
adminduty[playerid] = 1;
SetPlayerSkin(playerid,217);
SendClientMessage(playerid,0x00FF0068,"You are now on duty.");
return 1;
}
|
Since you are new here is something to start off with.
Код:
CMD:aduty(playerid)
{
if(playerVariables[playerid][pAdmin] == 0 || !IsPlayerAdmin(playerid)) return SendClientMessage(playerid,0xFF0000DB,"ERROR: You are not an Admin!");
adminduty[playerid] = 1;
SetPlayerSkin(playerid,217);
SendClientMessage(playerid,0x00FF0068,"You are now on duty.");
return 1;
}
|
|
I would except I started developing it in strcmp, a bit ago, is there a easy way to convert it?
One more question, how I have been learning to script is basicly by looking at other game modes, trying to replicate how they do it... since like *******/wiki tutorials seem to only talk about a specific thing. Is this a good way of learning? if not, how can I learn? |
|
Theres no easy way to convert, except command by command. I can do it for you if you would like.
|
|
Well this script is pre-developed, like I said im trying to learn how to script by reading others, trying to learn from it (Witch I am not quite sure if thats working so far), there are like 50,000 lines of code, I would feel terrible if I just "Sat on my ass" and you converted all of those.
P.S. I am yet able to create a command from scratch :/ |
if (strcmp("/aduty", cmdtext, true, 10) == 0)
{
if(PlayerInfo[playerid][pAdmin] >= 2)
{
SendClientMessage(playerid,0xFF0000DB,"ERROR: You are not an Admin!");
}
else
{
adminduty[playerid] = 1;
SetPlayerSkin(playerid,217);
SendClientMessage(playerid,0x00FF0068,"You are now on duty.");
}
return 1;
}
CMD:aduty(playerid,params[])//We dont use a /
{
if(PlayerInfo[playerid][pAdmin] >= 2)
{
SendClientMessage(playerid,0xFF0000DB,"ERROR: You are not an Admin!");
}
else
{
adminduty[playerid] = 1;
SetPlayerSkin(playerid,217);
SendClientMessage(playerid,0x00FF0068,"You are now on duty.");
}
return 1;
}
) I modified new.pwn for you to learn. Go to http://pastebin.com/dwbABZ5r and see by yourself