if(!strcmp(cmdtext,"/sms",true,4))
{
if(cmdtext[4]==0) {SendClientMessage(playerid,MELYNA, "usage: /sms [name] [text]"); return 1;}
new vardas[MAX_PLAYER_NAME],vardas2[MAX_PLAYER_NAME],atext[128];
strmid(vardas,GetArgument(1, cmdtext,0),0,MAX_PLAYER_NAME);
if(!strcmp(vardas,"necrotel",true))
{
new name[MAX_PLAYER_NAME]; GetPlayerName(playerid,name,sizeof(name));
strmid(atext,GetArgument(2, cmdtext,true),0,sizeof(atext));
if(!strcmp(atext,"0",true))
{
SendClientMessage(playerid,RAUDONA, "Sms with no text?!.");
return 1;
}
SetTimerEx("SMSsystem",(1+random(4))*1000,false,"i s",playerid,atext);
SendSMS(INVALID_PLAYER_ID,name,"NecroTel",atext,pl ayerid);
return 1;
}
if(playerDB[playerid][mobsas] < 2)
{
SendClientMessage(playerid,ZALIA3,"no money in your tel acc");
return 1;
}
new recieverid = GetPlayeridMid(vardas);
if(recieverid == INVALID_PLAYER_ID)
{
SendClientMessage(playerid, ZALIA3, "no player.");
return 1;
}
strmid(atext,GetArgument(2, cmdtext,true),0,sizeof(atext));
if(!strcmp(atext,"0",true))
{
SendClientMessage(playerid, ZALIA3, "sms with no text?!.");
return 1;
}
GetPlayerName(playerid,vardas2,sizeof(vardas2));
GetPlayerName(recieverid,vardas,sizeof(vardas));
playerDB[playerid][mobsas]-=2;
SendSMS(recieverid,vardas2,vardas,atext,playerid);
return 1;
}
|